\(\int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx\) [258]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 30 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=-\sqrt {a \sec ^2(x)}+\frac {\left (a \sec ^2(x)\right )^{3/2}}{3 a} \]

[Out]

1/3*(a*sec(x)^2)^(3/2)/a-(a*sec(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3738, 4209, 45} \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {\left (a \sec ^2(x)\right )^{3/2}}{3 a}-\sqrt {a \sec ^2(x)} \]

[In]

Int[Tan[x]^3*Sqrt[a + a*Tan[x]^2],x]

[Out]

-Sqrt[a*Sec[x]^2] + (a*Sec[x]^2)^(3/2)/(3*a)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4209

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Dist[b/(2*f), Subst[In
t[(-1 + x)^((m - 1)/2)*(b*x)^(p - 1), x], x, Sec[e + f*x]^2], x] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p] &&
 IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {a \sec ^2(x)} \tan ^3(x) \, dx \\ & = \frac {1}{2} a \text {Subst}\left (\int \frac {-1+x}{\sqrt {a x}} \, dx,x,\sec ^2(x)\right ) \\ & = \frac {1}{2} a \text {Subst}\left (\int \left (-\frac {1}{\sqrt {a x}}+\frac {\sqrt {a x}}{a}\right ) \, dx,x,\sec ^2(x)\right ) \\ & = -\sqrt {a \sec ^2(x)}+\frac {\left (a \sec ^2(x)\right )^{3/2}}{3 a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.67 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{3} \sqrt {a \sec ^2(x)} \left (-3+\sec ^2(x)\right ) \]

[In]

Integrate[Tan[x]^3*Sqrt[a + a*Tan[x]^2],x]

[Out]

(Sqrt[a*Sec[x]^2]*(-3 + Sec[x]^2))/3

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {\left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{3 a}-\sqrt {a +a \tan \left (x \right )^{2}}\) \(29\)
default \(\frac {\left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{3 a}-\sqrt {a +a \tan \left (x \right )^{2}}\) \(29\)
risch \(-\frac {2 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left (3 \,{\mathrm e}^{4 i x}+2 \,{\mathrm e}^{2 i x}+3\right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{2}}\) \(46\)

[In]

int((a+a*tan(x)^2)^(1/2)*tan(x)^3,x,method=_RETURNVERBOSE)

[Out]

1/3/a*(a+a*tan(x)^2)^(3/2)-(a+a*tan(x)^2)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.60 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{3} \, \sqrt {a \tan \left (x\right )^{2} + a} {\left (\tan \left (x\right )^{2} - 2\right )} \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^3,x, algorithm="fricas")

[Out]

1/3*sqrt(a*tan(x)^2 + a)*(tan(x)^2 - 2)

Sympy [F]

\[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\int \sqrt {a \left (\tan ^{2}{\left (x \right )} + 1\right )} \tan ^{3}{\left (x \right )}\, dx \]

[In]

integrate((a+a*tan(x)**2)**(1/2)*tan(x)**3,x)

[Out]

Integral(sqrt(a*(tan(x)**2 + 1))*tan(x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 276 vs. \(2 (24) = 48\).

Time = 0.51 (sec) , antiderivative size = 276, normalized size of antiderivative = 9.20 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=-\frac {2 \, {\left ({\left (3 \, \cos \left (5 \, x\right ) + 2 \, \cos \left (3 \, x\right ) + 3 \, \cos \left (x\right )\right )} \cos \left (6 \, x\right ) + 3 \, {\left (3 \, \cos \left (4 \, x\right ) + 3 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (5 \, x\right ) + 3 \, {\left (2 \, \cos \left (3 \, x\right ) + 3 \, \cos \left (x\right )\right )} \cos \left (4 \, x\right ) + 2 \, {\left (3 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (3 \, x\right ) + 9 \, \cos \left (2 \, x\right ) \cos \left (x\right ) + {\left (3 \, \sin \left (5 \, x\right ) + 2 \, \sin \left (3 \, x\right ) + 3 \, \sin \left (x\right )\right )} \sin \left (6 \, x\right ) + 9 \, {\left (\sin \left (4 \, x\right ) + \sin \left (2 \, x\right )\right )} \sin \left (5 \, x\right ) + 3 \, {\left (2 \, \sin \left (3 \, x\right ) + 3 \, \sin \left (x\right )\right )} \sin \left (4 \, x\right ) + 6 \, \sin \left (3 \, x\right ) \sin \left (2 \, x\right ) + 9 \, \sin \left (2 \, x\right ) \sin \left (x\right ) + 3 \, \cos \left (x\right )\right )} \sqrt {a}}{3 \, {\left (2 \, {\left (3 \, \cos \left (4 \, x\right ) + 3 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (6 \, x\right ) + \cos \left (6 \, x\right )^{2} + 6 \, {\left (3 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + 9 \, \cos \left (4 \, x\right )^{2} + 9 \, \cos \left (2 \, x\right )^{2} + 6 \, {\left (\sin \left (4 \, x\right ) + \sin \left (2 \, x\right )\right )} \sin \left (6 \, x\right ) + \sin \left (6 \, x\right )^{2} + 9 \, \sin \left (4 \, x\right )^{2} + 18 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 9 \, \sin \left (2 \, x\right )^{2} + 6 \, \cos \left (2 \, x\right ) + 1\right )}} \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^3,x, algorithm="maxima")

[Out]

-2/3*((3*cos(5*x) + 2*cos(3*x) + 3*cos(x))*cos(6*x) + 3*(3*cos(4*x) + 3*cos(2*x) + 1)*cos(5*x) + 3*(2*cos(3*x)
 + 3*cos(x))*cos(4*x) + 2*(3*cos(2*x) + 1)*cos(3*x) + 9*cos(2*x)*cos(x) + (3*sin(5*x) + 2*sin(3*x) + 3*sin(x))
*sin(6*x) + 9*(sin(4*x) + sin(2*x))*sin(5*x) + 3*(2*sin(3*x) + 3*sin(x))*sin(4*x) + 6*sin(3*x)*sin(2*x) + 9*si
n(2*x)*sin(x) + 3*cos(x))*sqrt(a)/(2*(3*cos(4*x) + 3*cos(2*x) + 1)*cos(6*x) + cos(6*x)^2 + 6*(3*cos(2*x) + 1)*
cos(4*x) + 9*cos(4*x)^2 + 9*cos(2*x)^2 + 6*(sin(4*x) + sin(2*x))*sin(6*x) + sin(6*x)^2 + 9*sin(4*x)^2 + 18*sin
(4*x)*sin(2*x) + 9*sin(2*x)^2 + 6*cos(2*x) + 1)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {{\left (a \tan \left (x\right )^{2} + a\right )}^{\frac {3}{2}} - 3 \, \sqrt {a \tan \left (x\right )^{2} + a} a}{3 \, a} \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^3,x, algorithm="giac")

[Out]

1/3*((a*tan(x)^2 + a)^(3/2) - 3*sqrt(a*tan(x)^2 + a)*a)/a

Mupad [B] (verification not implemented)

Time = 11.89 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.63 \[ \int \tan ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=-\frac {\sqrt {2}\,\sqrt {a}\,\left (6\,{\cos \left (x\right )}^2-2\right )}{3\,{\left (2\,{\cos \left (x\right )}^2\right )}^{3/2}} \]

[In]

int(tan(x)^3*(a + a*tan(x)^2)^(1/2),x)

[Out]

-(2^(1/2)*a^(1/2)*(6*cos(x)^2 - 2))/(3*(2*cos(x)^2)^(3/2))